// AUTO GENERATED CODE!
// CODE GENERATOR WILL NOT PRESERVE MANUAL CHANGES TO THIS CODE!
// 

// MIT License (MIT)
// 
// Copyright (c) 2014 K Ercan Turkarslan
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 


using System;

namespace Mios.Generated.ServiceFiles
{
    // Generated from S_VistaAlarmPanel1.xml
    
    public class VistaAlarmPanel1Service : MiosService
    {
        #region PluginVersion : String;
        private String _mPluginVersion;
        
        public String PluginVersion
        {
            get
            {
                return _mPluginVersion ?? GetPluginVersion();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetPluginVersion() : String;
        public String GetPluginVersion()
        {
            _mPluginVersion = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PluginVersion"));
            
            return _mPluginVersion;
        }
        #endregion Action GetPluginVersion
        
        #endregion
        
        #region DebugMode : Boolean;
        private Boolean? _mDebugMode;
        
        public Boolean DebugMode
        {
            get
            {
                return _mDebugMode ?? GetDebugMode();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetDebugMode() : Boolean;
        public Boolean GetDebugMode()
        {
            _mDebugMode = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "DebugMode"));
            
            return _mDebugMode.Value;
        }
        #endregion Action GetDebugMode
        
        #endregion
        
        #region NumPartitions : Byte;
        private Byte? _mNumPartitions;
        
        public Byte NumPartitions
        {
            get
            {
                return _mNumPartitions ?? GetNumPartitions();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetNumPartitions() : Byte;
        public Byte GetNumPartitions()
        {
            _mNumPartitions = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "NumPartitions"));
            
            return _mNumPartitions.Value;
        }
        #endregion Action GetNumPartitions
        
        #endregion
        
        #region KeypadAddresses : String;
        private String _mKeypadAddresses;
        
        public String KeypadAddresses
        {
            get
            {
                return _mKeypadAddresses ?? GetKeypadAddresses();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetKeypadAddresses() : String;
        public String GetKeypadAddresses()
        {
            _mKeypadAddresses = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "KeypadAddresses"));
            
            return _mKeypadAddresses;
        }
        #endregion Action GetKeypadAddresses
        
        #endregion
        
        #region ChimeMode : Boolean;
        private Boolean? _mChimeMode;
        
        public Boolean ChimeMode
        {
            get
            {
                return _mChimeMode ?? GetChimeMode();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetChimeMode() : Boolean;
        public Boolean GetChimeMode()
        {
            _mChimeMode = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ChimeMode"));
            
            return _mChimeMode.Value;
        }
        #endregion Action GetChimeMode
        
        #endregion
        
        #region ConnectionDown : Boolean;
        private Boolean? _mConnectionDown;
        
        public Boolean ConnectionDown
        {
            get
            {
                return _mConnectionDown ?? GetConnectionDown();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetConnectionDown() : Boolean;
        public Boolean GetConnectionDown()
        {
            _mConnectionDown = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ConnectionDown"));
            
            return _mConnectionDown.Value;
        }
        #endregion Action GetConnectionDown
        
        #endregion
        
        #region Zones : String;
        private String _mZones;
        
        public String Zones
        {
            get
            {
                return _mZones ?? GetZones();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetZones() : String;
        public String GetZones()
        {
            _mZones = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Zones"));
            
            return _mZones;
        }
        #endregion Action GetZones
        
        #endregion
        
        #region SecureStore : Boolean;
        private Boolean? _mSecureStore;
        
        public Boolean SecureStore
        {
            get
            {
                return _mSecureStore ?? GetSecureStore();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetSecureStore() : Boolean;
        public Boolean GetSecureStore()
        {
            _mSecureStore = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "SecureStore"));
            
            return _mSecureStore.Value;
        }
        #endregion Action GetSecureStore
        
        #endregion
        
        #region TTL : UInt16;
        private UInt16? _mTTL;
        
        public UInt16 TTL
        {
            get
            {
                return _mTTL ?? GetTTL();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetTTL() : UInt16;
        public UInt16 GetTTL()
        {
            _mTTL = FromLuupUInt16(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "TTL"));
            
            return _mTTL.Value;
        }
        #endregion Action GetTTL
        
        #endregion
        
        #region AlarmZone : Byte;
        private Byte? _mAlarmZone;
        
        public Byte AlarmZone
        {
            get
            {
                return _mAlarmZone ?? GetAlarmZone();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetAlarmZone() : Byte;
        public Byte GetAlarmZone()
        {
            _mAlarmZone = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AlarmZone"));
            
            return _mAlarmZone.Value;
        }
        #endregion Action GetAlarmZone
        
        #endregion
        
        #region CheckConnectionTimer : UInt16;
        private UInt16? _mCheckConnectionTimer;
        
        public UInt16 CheckConnectionTimer
        {
            get
            {
                return _mCheckConnectionTimer ?? GetCheckConnectionTimer();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetCheckConnectionTimer() : UInt16;
        public UInt16 GetCheckConnectionTimer()
        {
            _mCheckConnectionTimer = FromLuupUInt16(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "CheckConnectionTimer"));
            
            return _mCheckConnectionTimer.Value;
        }
        #endregion Action GetCheckConnectionTimer
        
        #endregion
        
        #region VirtualZones : String;
        private String _mVirtualZones;
        
        public String VirtualZones
        {
            get
            {
                return _mVirtualZones ?? GetVirtualZones();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetVirtualZones() : String;
        public String GetVirtualZones()
        {
            _mVirtualZones = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "VirtualZones"));
            
            return _mVirtualZones;
        }
        #endregion Action GetVirtualZones
        
        #endregion
        
        #region DisableSendStar : Boolean;
        private Boolean? _mDisableSendStar;
        
        public Boolean DisableSendStar
        {
            get
            {
                return _mDisableSendStar ?? GetDisableSendStar();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetDisableSendStar() : Boolean;
        public Boolean GetDisableSendStar()
        {
            _mDisableSendStar = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "DisableSendStar"));
            
            return _mDisableSendStar.Value;
        }
        #endregion Action GetDisableSendStar
        
        #endregion
        
        #region FaultedZones : String;
        // WARNING: This state variable was not defined in the Service Description file.
        // However it was referenced by one or more Actions as their related state variable.
        // Or it was returned by Vera in USER_DATA xml.
        // This may be due to a typo in RelatedStateVariable definition or missing State Variable.
        
        private String _mFaultedZones;
        
        public String FaultedZones
        {
            get
            {
                return _mFaultedZones ?? GetFaultedZones();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetFaultedZones() : String;
        public String GetFaultedZones()
        {
            _mFaultedZones = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "FaultedZones"));
            
            return _mFaultedZones;
        }
        #endregion Action GetFaultedZones
        
        #endregion
        
        
        #region Action RequestLetteredKeyPress(String key, String pINCode)
        public void RequestLetteredKeyPress(String key, String pINCode)
        {
            if (String.IsNullOrEmpty(key))
                throw new ArgumentNullException("key");
            
            if (String.IsNullOrEmpty(pINCode))
                throw new ArgumentNullException("pINCode");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "RequestLetteredKeyPress"
                , String.Format("Key={0}", ToLuup(key))
                , String.Format("PINCode={0}", ToLuup(pINCode))
                ); // Engine.Luup_CallAction
        }
        #endregion Action RequestLetteredKeyPress
        
        #region Action BypassZones(String zones, String pINCode)
        public void BypassZones(String zones, String pINCode)
        {
            if (String.IsNullOrEmpty(zones))
                throw new ArgumentNullException("zones");
            
            if (String.IsNullOrEmpty(pINCode))
                throw new ArgumentNullException("pINCode");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "BypassZones"
                , String.Format("Zones={0}", ToLuup(zones))
                , String.Format("PINCode={0}", ToLuup(pINCode))
                ); // Engine.Luup_CallAction
        }
        #endregion Action BypassZones
        
        #region Action ToggleChimeMode(String pINCode)
        public void ToggleChimeMode(String pINCode)
        {
            if (String.IsNullOrEmpty(pINCode))
                throw new ArgumentNullException("pINCode");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "ToggleChimeMode"
                , String.Format("PINCode={0}", ToLuup(pINCode))
                ); // Engine.Luup_CallAction
        }
        #endregion Action ToggleChimeMode
        
        #region Action SetChimeMode(Boolean mode, String pINCode)
        public void SetChimeMode(Boolean mode, String pINCode)
        {
            if (String.IsNullOrEmpty(pINCode))
                throw new ArgumentNullException("pINCode");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "SetChimeMode"
                , String.Format("Mode={0}", ToLuup(mode))
                , String.Format("PINCode={0}", ToLuup(pINCode))
                ); // Engine.Luup_CallAction
        }
        #endregion Action SetChimeMode
        
        #region Action StorePinCode(String pINCode)
        public void StorePinCode(String pINCode)
        {
            if (String.IsNullOrEmpty(pINCode))
                throw new ArgumentNullException("pINCode");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "StorePinCode"
                , String.Format("PINCode={0}", ToLuup(pINCode))
                ); // Engine.Luup_CallAction
        }
        #endregion Action StorePinCode
        
        #region Action ClearTask()
        public void ClearTask()
        {
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "ClearTask");
        }
        #endregion Action ClearTask
        
        
        #region Method SetVariable(String name, String value) : Boolean;
        internal override Boolean SetVariable(String name, String value)
        {
            switch(name)
            {
                case "AlarmZone":
                    _mAlarmZone = FromLuupByte(value); return true;
                case "CheckConnectionTimer":
                    _mCheckConnectionTimer = FromLuupUInt16(value); return true;
                case "ChimeMode":
                    _mChimeMode = FromLuupBoolean(value); return true;
                case "ConnectionDown":
                    _mConnectionDown = FromLuupBoolean(value); return true;
                case "DebugMode":
                    _mDebugMode = FromLuupBoolean(value); return true;
                case "DisableSendStar":
                    _mDisableSendStar = FromLuupBoolean(value); return true;
                case "FaultedZones":
                    _mFaultedZones = FromLuupString(value); return true;
                case "KeypadAddresses":
                    _mKeypadAddresses = FromLuupString(value); return true;
                case "NumPartitions":
                    _mNumPartitions = FromLuupByte(value); return true;
                case "PluginVersion":
                    _mPluginVersion = FromLuupString(value); return true;
                case "SecureStore":
                    _mSecureStore = FromLuupBoolean(value); return true;
                case "TTL":
                    _mTTL = FromLuupUInt16(value); return true;
                case "VirtualZones":
                    _mVirtualZones = FromLuupString(value); return true;
                case "Zones":
                    _mZones = FromLuupString(value); return true;
                default:
                    return false;
            }
        }
        #endregion Method SetVariable
        
        public VistaAlarmPanel1Service(MiosEngine engine, UInt32 deviceId, String serviceId)
            : base(engine, deviceId, serviceId)
        {
            
        } //End Constructor
    } //End of class
} //End of Namespace

